﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace MachineVision.Domain
{
    public class MissionHistoryInfo : IEntity
    {
        /// <summary>
        /// 车名(编号)
        /// </summary>
        public string NO { get; set; }
        /// <summary>
        /// 任务名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 任务类型
        /// </summary>
        public MissionType Type { get; set; }

        /// <summary>
        /// 站点名（可空）
        /// </summary>
        public string? Terminal { get; set; }

        /// <summary>
        /// 设备名（可空）
        /// </summary>
        public string? Equipment { get; set; }

        /// <summary>
        /// 巡检结果数值（可空）
        /// </summary>
        public double? ResultValue { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime EndTime { get; set; }

        /// <summary>
        /// 检测结果（可空）
        /// </summary>
        public string? DetectionResult { get; set; }

        /// <summary>
        /// 视觉任务号（可空）
        /// </summary>
        public int? VisionMissionId { get; set; }

        /// <summary>
        /// 机械臂任务号（可空）
        /// </summary>
        public int? ArmCode { get; set; }

        /// <summary>
        /// 倍率（可空）
        /// </summary>
        public double? Zoom { get; set; }

        /// <summary>
        /// 灯光开关（可空）
        /// </summary>
        public int? IOControl { get; set; }

        /// <summary>
        /// 图片（可空）,base64
        /// </summary>
        public string? VisionFile { get; set; }
       /// <summary>
       /// 工作编号
       /// </summary>
        public string? WorkNum { get; set; }
        /// <summary>
        /// 工作区
        /// </summary>
        public string? WorkPlace { get; set; }
        /// <summary>
        /// 温度
        /// </summary>
        public double Temperature { get; set; }
        /// <summary>
        /// 湿度
        /// </summary>
        public double Humidity { get; set; }

    }

    public enum MissionType
    {
        无 = 0,
        充电任务,
        视觉_测温,
        视觉_表针识别,
        视觉_拍照,
        视觉_炉内漏水,
        机械臂归零,
        视觉_炉门门锁,
        视觉_漏火识别,
        视觉_电打火,
        视觉_撒料漏料,
        视觉_管道漏水,
        自动充电任务 = 999
    }
}